import requests
import re

url='https://www.baidu.com'
head={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; x64) AppleWebKit/537.36(KHTML, like"
}
req=requests.get()
with open("baidu.html",'w',encoding='utf-8',newline='') as f:
    f.write(req.text)
patten = re.compile()